home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / vdl020d.zip / VALARM.DOC < prev    next >
Text File  |  1993-04-14  |  34KB  |  1,610 lines

  1. {
  2.  ══════════════════════════════════════════════════════════════════════════════
  3.  
  4.  Visionix RealTime Alarm Clock Functions Unit (VALARM)
  5.  Copyright 1991,92,93 Visionix
  6.  ALL RIGHTS RESERVED
  7.  
  8.  ──────────────────────────────────────────────────────────────────────────────
  9.  
  10.  Revision history in reverse chronological order:
  11.  
  12.  Initials  Date      Comment
  13.  ────────  ────────  ──────────────────────────────────────────────────────────
  14.  
  15.  lpg       03/11/93  Source Code Documentation Complete
  16.  
  17.  mep       02/11/93  Cleaned up code for beta release
  18.  
  19.  jrt       02/08/93  Sync with beta 0.12 release
  20.  
  21.  jrt       12/07/92  Sync with beta 0.11 release
  22.  
  23.  lpg       12/04/92  Everything functional and tested. (works except CallFlag)
  24.  
  25.  lpg       12/02/92  Added RealTime Clock System Time Functions.
  26.                        Get/SetSysTime,Get/SetSysDate,SystemTime/Date,
  27.                        Sync,SyncSystemTime/Date,Get/SetDayLightSavings
  28.  
  29.  lpg       11/30/92  Created Alarm Unit
  30.  
  31.  ══════════════════════════════════════════════════════════════════════════════
  32.  
  33.  Caveats/Known Bugs
  34.  
  35.     Register C - Alarm Call Flag is Invalid.  Seems to only be briefly
  36.       set between interrupts.  Need to keep own flags to cover for this.
  37.  
  38.       AFFECTS: AlarmCallFlag, UnsetAlarmCallFlag.
  39.  
  40.  
  41.  
  42.  ══════════════════════════════════════════════════════════════════════════════
  43. }
  44.  
  45. (*-
  46.  
  47. NOTES on the RTC Registers:
  48.  
  49.   Register    Meaning
  50.   ----------- -----------------------------------
  51.     0(00h) ....... Current Second
  52.     1(01h) ....... Alarm Second
  53.     2(02h) ....... Current Minute
  54.     3(03h) ....... Alarm Minute
  55.     4(04h) ....... Current Hour
  56.     5(05h) ....... Alarm Hour
  57.     6(06h) ....... Day of the Week
  58.     7(07h) ....... Number of Day
  59.     8(08h) ....... Month
  60.     9(09h) ....... Year
  61.    10(0Ah) ....... Clock Status Register A
  62.    11(0Bh) ....... Clock Status Register B
  63.    12(0Ch) ....... Clock Status Register C
  64.    13(0Dh) ....... Clock Status Register D
  65.    14(0Eh) ....... Diagnostic Byte
  66.    50(32h) ....... Year Hundreds
  67.  
  68.   ---------------------------
  69.  
  70.   STATUS REGISTER A (BYTE)
  71.  
  72.    76543210 (Bits) = BYTE
  73.  
  74.    Bit
  75.     7   - VIP 0=Time Not Actualized, 1=Time Actualized
  76.     6-4 - Time Frequency
  77.     3-0 - Interrupt Frequency
  78.  
  79.   ---------------------------
  80.  
  81.   STATUS REGISTER B
  82.  
  83.    76543210 (Bits) = BYTE
  84.  
  85.    Bit
  86.     7 - Actualized Time                         (0=yes,1=no)
  87.     6 - Call Periodic Interrupt                 (0=no, 1=yes)
  88.     5 - Call Alarm Interrupt                    (0=no,1=yes)
  89.     4 - Call Interrupt after time Actualization (0=no,1=yes)
  90.     3 - Block Generator                         (0=off,1=on)
  91.     2 - Time and date Format                    (0=BCD,1=binary)
  92.     1 - 24/12 Hour Format                       (0=12-hour,1=24hour)
  93.     0 - DayLight Savings Time                   (0=yes,1=no)
  94.  
  95.   ---------------------------
  96.  
  97.   STATUS REGISTER C
  98.  
  99.    76543210 (Bits) = BYTE
  100.  
  101.    Bits:
  102.     7 - UNUSED
  103.     6 - Alarm Time Reached
  104.     5 - Periodic Interrupt Call
  105.     4 - Close Time Actualization
  106.     3 - UNUSED
  107.     2 - UNUSED
  108.     1 - UNUSED
  109.     0 - UNUSED
  110.  
  111.   Generally indicates the reason for this Time Interrupt.
  112.  
  113.   Bit 6: 1=Reason for Interrupt was for Alarm Time Reached
  114.   Bit 5: 1=Reason was for was a routine Clock Update Call.
  115.   Bit 4: 1=Reason was that Time Actuation was Close (Restarted?)
  116.  
  117.   ---------------------------
  118.  
  119.   STATUS REGISTER D
  120.  
  121.     76543210 (Bits) = BYTE
  122.  
  123.     Bits:
  124.      7 - Battery Status (1=battery ok,0=Battery low/needs replacement)
  125.      6 - ?
  126.      5 - ?
  127.      4 - ?
  128.      3 - ?
  129.      2 - ?
  130.      1 - ?
  131.  
  132.   ---------------------------
  133.  
  134.   DIAGNOSTIC BYTE
  135.  
  136.   Bits
  137.    7 - Battery (0=Battery is OK, Battery Dead or almost Dead)
  138.    6 - Checksum (0=Checksum in memory location 46 and 47 OK,
  139.                  1=Checksum in memory location 46 and 47 is FALSE)
  140.    5 - Config (0=Configuration in Memory Location 20 is OK,
  141.                1=Another Configuration found during booting)
  142.    4 - Memory (0=Mem Size in Memory Locations 21-24
  143.                1=Other Memory Size Determined during Booting)
  144.    3 - Hard Disk Controller (0=HD & Controller OK
  145.                              1=Hard Disk not Present or Not Functional)
  146.    2 - RESERVED
  147.    1 - RESERVED
  148.    0 - RESERVED
  149.  
  150.    --------------------------
  151.  
  152. -*)
  153.  
  154. Unit VAlarm;
  155.  
  156.  
  157. Uses
  158.   DOS,
  159.   VDates,
  160.   VGen;
  161.  
  162. {────────────────────────────────────────────────────────────────────────────}
  163.  
  164. Var
  165.  
  166.   AlarmCalled : BOOLEAN;     { Was the Alarm Called? }
  167.   AlarmMsg    : STRING;      { Area Where Alarm INT can pass data }
  168.  
  169.  
  170.  
  171.   {----------------------------------}
  172.   { Primary Alarm Interrupt Function }
  173.   {----------------------------------}
  174.  
  175.   Function  SetAlarmProc(         ProcPtr        : POINTER   ) : BYTE;
  176.  
  177.   Function  ClearAlarmProc                                     : BYTE;
  178.  
  179.  
  180.  
  181.   {---------------------------}
  182.   { Low-Level Alarm Functions }
  183.   {---------------------------}
  184.  
  185.   Function  GetRegA                                            : BYTE;
  186.  
  187.   Function  GetRegB                                            : BYTE;
  188.  
  189.   Function  GetRegC                                            : BYTE;
  190.  
  191.   Function  GetRegD                                            : BYTE;
  192.  
  193.   Function  AlarmSetFlag(     Var BcdHour        : BYTE;
  194.                               Var BcdMin         : BYTE;
  195.                               Var BcdSec         : BYTE      ) : BOOLEAN;
  196.  
  197.   Procedure UnsetAlarmSetFlag;
  198.  
  199.  
  200.  
  201.   {-------------------------------------------------------}
  202.   {NOTE: Call Flag is Invalid. Also Can't Set or Reset it!}
  203.  
  204.   Function  AlarmCallFlag                                      : BOOLEAN;
  205.  
  206.   Procedure UnsetAlarmCallFlag;
  207.  
  208.   {-------------------------------------------------------}
  209.  
  210.  
  211.   Function  SetAlarmTime(         BcdHour        : BYTE;
  212.                                   BcdMin         : BYTE;
  213.                                   BcdSec         : BYTE      ) : BYTE;
  214.  
  215.   Function  ResetAlarmTime(       BcdHour        : BYTE;
  216.                                   BcdMin         : BYTE;
  217.                                   BcdSec         : BYTE      ) : BYTE;
  218.  
  219.   Function  UnsetAlarmTime                                     : BYTE;
  220.  
  221.  
  222.  
  223.   {---------------------------}
  224.   { Mid-Level Alarm Functions }
  225.   {---------------------------}
  226.  
  227.   Function  SetAlarmOn(           Time           : TTime     ) : BOOLEAN;
  228.  
  229.   Function  SetAlarmOff                                        : BOOLEAN;
  230.  
  231.   Function  AlarmIsSet                                         : BOOLEAN;
  232.  
  233.   Function  AlarmWasCalled                                     : BOOLEAN;
  234.  
  235.  
  236. (*  **************** MOVED TO VALARMHI.PAS ***************
  237.   {----------------------------}
  238.   { High-Level Alarm Functions }
  239.   {----------------------------}
  240.  
  241.   { keeps sorted alarm list and manages alarm calls }
  242.  
  243.   Function  AddAlarm() : BOOLEAN;
  244.   Function  SubAlarm() : BOOLEAN;
  245.  
  246.   Function  CallAlarm(             Var ProcItem  : TProc;
  247.                                        ProcPtr   : POINTER      ) : BOOLEAN;
  248.  
  249.  
  250.   Function  NewAlarm(              Var ProcItem  : TProc;
  251.                                        ProcPtr   : POINTER;
  252.                                        Time      : TTime        ) : BOOLEAN;
  253.  
  254.  
  255.   Function  DisposeAlarm(              ProcItem  : TProc        ) : BOOLEAN;
  256.  
  257. *)
  258.  
  259.   {---------------------------------}
  260.   { Low-Level System Time Functions }
  261.   {---------------------------------}
  262.  
  263.   Procedure GetSysTime(       Var BcdHour        : BYTE;
  264.                               Var BcdMin         : BYTE;
  265.                               Var BcdSec         : BYTE      );
  266.  
  267.   Procedure SetSysTime(           BcdHour        : BYTE;
  268.                                   BcdMin         : BYTE;
  269.                                   BcdSec         : BYTE      );
  270.  
  271.   Procedure GetSysDate(       Var BcdDay         : BYTE;
  272.                               Var BcdMonth       : BYTE;
  273.                               Var BcdYear        : BYTE;
  274.                               Var BcdCent        : BYTE;
  275.                               Var BcdDOW         : BYTE      );
  276.  
  277.   Procedure SetSysDate(           BcdDay         : BYTE;
  278.                                   BcdMonth       : BYTE;
  279.                                   BcdYear        : BYTE;
  280.                                   BcdCent        : BYTE;
  281.                                   BcdDOW         : BYTE      );
  282.  
  283.  
  284.  
  285.   {----------------------------------}
  286.   { High-Level System Time Functions }
  287.   {----------------------------------}
  288.  
  289.   Procedure Sync;
  290.  
  291.   Procedure AccuSync;
  292.  
  293.   Function  GetSystemTime                                      : TTime;
  294.  
  295.   Function  GetSystemDate                                      : TDate;
  296.  
  297.   Procedure SyncSystemTime(       NewTime        : TTime     );
  298.  
  299.   Procedure SyncSystemDate(       NewDate        : TDate     );
  300.  
  301.   Function  GetDayLightSavings                                 : BOOLEAN;
  302.  
  303.   Procedure SetDayLightSavings(   DLS            : BOOLEAN   );
  304.  
  305. {────────────────────────────────────────────────────────────────────────────}
  306.  
  307.  
  308. ──────────────────────────────────────────────────────────────────────────────
  309.  
  310.  
  311. [FUNCTION]
  312.  
  313. Function SetAlarmProc(            ProcPtr        : POINTER   ) : BYTE;
  314.  
  315. [PARAMETERS]
  316.  
  317. ProcPtr     Far Pointer to User Provided Alarm Procedure
  318.  
  319. [RETURNS]
  320.  
  321. Status Code ($00 = Successful)
  322.  
  323. [DESCRIPTION]
  324.  
  325. Installs a Provided Alarm Function into the Alarm Interrupt Routine.
  326. Now, whenever the RTC Alarm Call Interrupt is made, this function is
  327. called.
  328.  
  329. WARNING: This Function MUST be kept very simple as some std functions
  330. don't actually return and will lock up the System!
  331.  
  332. Sets the User Alarm Procedure by Storing the Original Alarm Proc
  333. Vector and Replacing it the User Provided Vector.
  334.  
  335. NOTE: All the following Alarm Clock Functions require that the Caller
  336. perform this action prior to any Activity, otherwise they will all
  337. report Errors.
  338.  
  339. IMPORTANT: As this function is an Interrupt (!!!) it absolutely MUST
  340. be kept simple and Obey all rules of Interrupt Procedures.  Watch out
  341. for Nesting Interrupts and other Nasties as they WILL Lock the System!
  342. If you need to pass data to or from this Procedure, store it and look
  343. for it at a predetermined location.  It should also be noted by the
  344. Programmer that some std functions don't properly call RETURN when
  345. complete (Even WriteLn!) and will Randomly Lock up the System when
  346. called.
  347.  
  348. [SEE-ALSO]
  349.  
  350. ClearAlarmProc
  351.  
  352. [EXAMPLE]
  353.  
  354. Procedure AlarmProc; FAR;
  355. BEGIN
  356.   Flag := TRUE;
  357. END;
  358.  
  359. VAR
  360.   Flag : BOOLEAN;
  361.  
  362. BEGIN
  363.  
  364.   Flag := FALSE;
  365.   SetAlarmProc( @AlarmProc );
  366.   SetAlarmOn( AddTime( CurrTime, 0, 0, 5 ) );  { Alarm 5 sec from Now! }
  367.  
  368.   While NOT KeyPressed Do;
  369.  
  370.   WriteLn( 'Alarm Called = ',Flag );
  371.   ClearAlarmProc;
  372.  
  373. END;
  374.  
  375.  
  376.  
  377. ──────────────────────────────────────────────────────────────────────────────
  378.  
  379.  
  380. [FUNCTION]
  381.  
  382. Function ClearAlarmProc                                        : BYTE;
  383.  
  384. [PARAMETERS]
  385.  
  386. (None)
  387.  
  388. [RETURNS]
  389.  
  390. Status Code ($00 = Successful)
  391.  
  392. [DESCRIPTION]
  393.  
  394. Removes the User Alarm Procedure by Restoring the Original
  395. System INT 4Ah Vector.
  396.  
  397. NOTE: Calling this Function will Disable all the Alarm Clock
  398. functions provided here.  This Function MUST be called Prior
  399. to Terminating the Host Application.
  400.  
  401. [SEE-ALSO]
  402.  
  403. SetAlarmProc
  404.  
  405. [EXAMPLE]
  406.  
  407. Procedure MyAlarmProc;  FAR;
  408. BEGIN
  409. END;
  410.  
  411. BEGIN
  412.  
  413.   If SetAlarmProc( @MyAlarmProc )=$00 Then
  414.     WriteLn( 'Alarm Procedure Cleared : ',ClearAlarmProc=$00 )
  415.   Else
  416.     WriteLn( 'Alarm Procedure was NEVER ACCEPTED!' );
  417.  
  418. END;
  419.  
  420.  
  421. ──────────────────────────────────────────────────────────────────────────────
  422.  
  423.  
  424. [FUNCTION]
  425.  
  426. Function GetRegA                                               : BYTE;
  427.  
  428. [PARAMETERS]
  429.  
  430. (None)
  431.  
  432. [RETURNS]
  433.  
  434. The RealTime Clock Status Register A Flags
  435.  
  436. [DESCRIPTION]
  437.  
  438. Reads and returns the RealTime Clock Status Register A
  439.  
  440. Flags are as follows:
  441.   Bits
  442.    7   = Time Actualization (0=NO, 1=YES)
  443.    6-4 = Time Frequency (010b)
  444.    3-0 = Interrupt Frequency (0110b)
  445.  
  446. [SEE-ALSO]
  447.  
  448. GetRegB
  449. GetRegC
  450. GetRegD
  451.  
  452. [EXAMPLE]
  453.  
  454. Uses VGen;
  455.  
  456. BEGIN
  457.  
  458.   WriteLn( 'Register A = ', ByteToBin( GetRegA ) );
  459.  
  460. END;
  461.  
  462.  
  463. ──────────────────────────────────────────────────────────────────────────────
  464.  
  465.  
  466. [FUNCTION]
  467.  
  468. Function GetRegB                                               : BYTE;
  469.  
  470. [PARAMETERS]
  471.  
  472. (None)
  473.  
  474. [RETURNS]
  475.  
  476. The RealTime Clock Status Register B Flags
  477.  
  478. [DESCRIPTION]
  479.  
  480. Reads and returns the RealTime Clock Status Register B
  481.  
  482. Flags are as follows:
  483.   Bits
  484.    7 = Actualized Time (0=YES, 1=NO)
  485.    6 = Call Periodic Interrupt (0=NO, 1=YES)
  486.    5 = Call Alarm Interrupt (0=NO, 1=YES)
  487.    4 = Call Intr after Time Actualization (0=NO, 1=YES)
  488.    3 = Block Generator (0=OFF, 1=ON)
  489.    2 = Time & Date Format (0=BCD, 1=Binary)
  490.    1 = 12/24 Hour Format (0=12 hour, 1=24 hour)
  491.    0 = Daylight Savings Time (0=YES, 1=NO)
  492.  
  493. [SEE-ALSO]
  494.  
  495. GetRegA
  496. GetRegC
  497. GetRegD
  498.  
  499. [EXAMPLE]
  500.  
  501. Uses VGen;
  502.  
  503. BEGIN
  504.  
  505.   WriteLn( 'Register B = ', ByteToBin( GetRegB ) );
  506.  
  507. END;
  508.  
  509.  
  510. ──────────────────────────────────────────────────────────────────────────────
  511.  
  512.  
  513. [FUNCTION]
  514.  
  515. Function GetRegC                                               : BYTE;
  516.  
  517. [PARAMETERS]
  518.  
  519. (None)
  520.  
  521. [RETURNS]
  522.  
  523. The RealTime Clock Status Register C Flags
  524.  
  525. [DESCRIPTION]
  526.  
  527. Reads and returns the RealTime Clock Status Register C.  The Flags
  528. int this Register represent the reasons for the Interrupt Call.
  529.  
  530. NOTE: Most probably they are cleared during each Intr and therefore
  531. only useful data if the INT 70h Function were being trapped.  Use
  532. extreme care in doing so.
  533.  
  534. Flags are as follows:
  535.   Bits
  536.    7   - UNKNOWN
  537.    6   - 1=Alarm Time Reached (seems between Intr ONLY!)
  538.    5   - 1=Periodic Interrupt Call
  539.    4   - 1=Close Time Actualization
  540.    3-0 - UNKNOWN
  541.  
  542. [SEE-ALSO]
  543.  
  544. GetRegA
  545. GetRegB
  546. GetRegD
  547.  
  548. [EXAMPLE]
  549.  
  550. Uses VGen;
  551.  
  552. BEGIN
  553.  
  554.   WriteLn( 'Register C = ', ByteToBin( GetRegC ) );
  555.  
  556. END;
  557.  
  558.  
  559. ──────────────────────────────────────────────────────────────────────────────
  560.  
  561.  
  562. [FUNCTION]
  563.  
  564. Function GetRegD                                               : BYTE;
  565.  
  566. [PARAMETERS]
  567.  
  568. (None)
  569.  
  570. [RETURNS]
  571.  
  572. The RealTime Clock Status Register D Flags
  573.  
  574. [DESCRIPTION]
  575.  
  576. Reads and returns the RealTime Clock Status Register D
  577.  
  578. Flags are as follows:
  579.   Bits
  580.    7   = Battery Status (0=Dead/Dying, 1=OK)
  581.    6-0 = UNKNOWN
  582.  
  583. [SEE-ALSO]
  584.  
  585. GetRegA
  586. GetRegB
  587. GetRegC
  588.  
  589. [EXAMPLE]
  590.  
  591. Uses VGen;
  592.  
  593. BEGIN
  594.  
  595.   WriteLn( 'Register D = ',ByteToBin( GetRegD ) );
  596.  
  597. END;
  598.  
  599.  
  600. ──────────────────────────────────────────────────────────────────────────────
  601.  
  602.  
  603. [FUNCTION]
  604.  
  605. Function AlarmSetFlag(        Var BcdHour        : BYTE;
  606.                               Var BcdMin         : BYTE;
  607.                               Var BcdSec         : BYTE      ) : BOOLEAN;
  608.  
  609. [PARAMETERS]
  610.  
  611. BcdHour     VAR Returned Previous Alarm Hour in BCD
  612. BcdMin      VAR Returned Previous Alarm Minutes in BCD
  613. BcdSec      VAR Returned Previous Alarm Seconds in BCD
  614.  
  615. [RETURNS]
  616.  
  617. (Function : Is the Alarm Set Flag Currently Set?)
  618. (VAR      : [BcdHour] Returned Previous Set Hour)
  619. (VAR      : [BcdMin] Returned Previous Set Minute)
  620. (VAR      : [BcdSec] Returned Previous Set Second)
  621.  
  622. [DESCRIPTION]
  623.  
  624. Low Level Function that Returns whether or not the Alarm Clock
  625. is Active as well as the stored Previous Alarm Time.
  626.  
  627. This is the most direct way to turn off the Alarm Clock.  Without
  628. knowing what other actions are taken by the Standard Interrupt
  629. Function, it would probably be better to use the Std Int Func over
  630. this unless you intend to turn it back on manually also.
  631.  
  632. [SEE-ALSO]
  633.  
  634. UnsetAlarmSetFlag
  635.  
  636. [EXAMPLE]
  637.  
  638. VAR
  639.   Hr,Min,Sec : BYTE;
  640.   Active     : BOOLEAN;
  641.  
  642. BEGIN
  643.  
  644.   Active := AlarmSetFlag( Hr, Min, Sec) );
  645.  
  646.   WriteLn( 'Alarm is Active :, Active );
  647.   WriteLn( 'Current/Previous Alarm Time is : Hr=',Hr,
  648.                                           ' Min=',Min,
  649.                                           ' Sec=',Sec );
  650. END;
  651.  
  652.  
  653. ──────────────────────────────────────────────────────────────────────────────
  654.  
  655.  
  656. [FUNCTION]
  657.  
  658. Procedure UnsetAlarmSetFlag;
  659.  
  660. [PARAMETERS]
  661.  
  662. (None)
  663.  
  664. [RETURNS]
  665.  
  666. (None)
  667.  
  668. [DESCRIPTION]
  669.  
  670. Turns the Alarm Trigger Flag to OFF, so that the Alarm Clock is
  671. not called.
  672.  
  673. This is the most direct way to turn off the Alarm Clock.  Without
  674. knowing what other actions are taken by the Standard Interrupt
  675. Function, it would probably be better to use the Std Int Func over
  676. this unless you intend to turn it back on manually also.
  677.  
  678. [SEE-ALSO]
  679.  
  680. AlarmSetFlag
  681.  
  682. [EXAMPLE]
  683.  
  684. BEGIN
  685.  
  686.   UnsetAlarmSetFlag;
  687.  
  688.   { Alarm should not be turned Off }
  689.  
  690. END;
  691.  
  692.  
  693. ──────────────────────────────────────────────────────────────────────────────
  694.  
  695.  
  696. [FUNCTION]
  697.  
  698. Function AlarmCallFlag                                         : BOOLEAN;
  699.  
  700. [PARAMETERS]
  701.  
  702. (None)
  703.  
  704. [RETURNS]
  705.  
  706. Is the Alarm Called Flag Set?
  707.  
  708. [DESCRIPTION]
  709.  
  710. Returns whether or not the Alarm has already been called.
  711.  
  712. NOTE: While it is perfectly valid to Read the Flag, it seems of
  713. little use as even when the alarm is called, this flag is never
  714. set.  Thus this data is of little use to the applications programmer.
  715. This will be corrected in future versions.
  716.  
  717. [SEE-ALSO]
  718.  
  719. SetAlarmOn
  720. SetAlarmOff
  721. AlarmIsSet
  722. AlarmWasCalled
  723.  
  724. [EXAMPLE]
  725.  
  726. BEGIN
  727.  
  728.   WriteLn( 'AlarmCallFlag Set : ', AlarmCallFlag );
  729.  
  730. END;
  731.  
  732.  
  733. ──────────────────────────────────────────────────────────────────────────────
  734.  
  735.  
  736. [FUNCTION]
  737.  
  738. Procedure UnsetAlarmCallFlag;
  739.  
  740. [PARAMETERS]
  741.  
  742. (None)
  743.  
  744. [RETURNS]
  745.  
  746. (None)
  747.  
  748. [DESCRIPTION]
  749.  
  750. Turns the Alarm Called Status to FALSE, so that the Alarm Clock
  751. is not considered to have been called already.
  752.  
  753. NOTE: While it is perfectly valid to Read the Flag, it seems of
  754. little use as even when the alarm is called, this flag is never
  755. set.  Thus this data is of little use to the applications programmer.
  756. This will be corrected in future versions.
  757.  
  758. [SEE-ALSO]
  759.  
  760. AlarmCallFlag
  761. SetAlarmOn
  762. SetAlarmOff
  763. AlarmIsSet
  764. AlarmWasCalled
  765.  
  766. [EXAMPLE]
  767.  
  768. BEGIN
  769.  
  770.   UnsetAlarmCallFlag;
  771.  
  772.   { Alarm Called Flag should not be FALSE (unset) }
  773.  
  774. END;
  775.  
  776.  
  777. ──────────────────────────────────────────────────────────────────────────────
  778.  
  779.  
  780. [FUNCTION]
  781.  
  782. Function SetAlarmTime(            BcdHour        : BYTE;
  783.                                   BcdMin         : BYTE;
  784.                                   BcdSec         : BYTE      ) : BYTE;
  785.  
  786. [PARAMETERS]
  787.  
  788. BcdHour     Desired Alarm Hours in BCD Format
  789. BcdMin      Desired Alarm Minutes in BCD Format
  790. BcdSec      Desired Alarm Seconds in BCD Format
  791.  
  792. [RETURNS]
  793.  
  794. Status Code ($00 = Success)
  795.  
  796. [DESCRIPTION]
  797.  
  798. This function loads the provided Alarm Time and turns on the System
  799. Alarm Clock.
  800.  
  801. NOTE: This Requires the caller to have Installed an Alarm Clock
  802. Interrupt Procedure (Thru SetAlarmProc) otherwise it will return
  803. an Error.
  804.  
  805. [SEE-ALSO]
  806.  
  807. ResetAlarmTime
  808. UnSetAlarmTime
  809.  
  810. [EXAMPLE]
  811.  
  812. VAR
  813.   Active : BOOLEAN;
  814.  
  815. BEGIN
  816.  
  817.   Active := SetAlarmTime( DecToBCD(14), DecToBCD(15), DecToBCD(30) ) = $00;
  818.  
  819.   WriteLn( 'Alarm is Set to 2:15:30PM : ', Active );
  820.  
  821. END;
  822.  
  823.  
  824. ──────────────────────────────────────────────────────────────────────────────
  825.  
  826.  
  827. [FUNCTION]
  828.  
  829. Function ResetAlarmTime(          BcdHour        : BYTE;
  830.                                   BcdMin         : BYTE;
  831.                                   BcdSec         : BYTE      ) : BYTE;
  832.  
  833. [PARAMETERS]
  834.  
  835. BcdHour     Desired Alarm Hours in BCD Format
  836. BcdMin      Desired Alarm Minutes in BCD Format
  837. BcdSec      Desired Alarm Seconds in BCD Format
  838.  
  839. [RETURNS]
  840.  
  841. Status Code ($00 = Success)
  842.  
  843. [DESCRIPTION]
  844.  
  845. Resets a previously Set Alarm Time to a New Alarm Time.  Once Set,
  846. You Must use this Method to Reset all New Alarm Times (Unless the
  847. Alarm has been Called).  This removes the Old Time before attempting
  848. to Set the New Time.
  849.  
  850. NOTE: This Requires the caller to have Installed an Alarm Clock
  851. Interrupt Procedure (Thru SetAlarmProc) otherwise it will return
  852. an Error.
  853.  
  854. [SEE-ALSO]
  855.  
  856. SetAlarmTime
  857. UnSetAlarmTime
  858.  
  859. [EXAMPLE]
  860.  
  861. VAR
  862.   Active : BOOLEAN;
  863.  
  864. BEGIN
  865.  
  866.   Active := SetAlarmTime( DecToBCD(14), DecToBCD(15), DecToBCD(30) ) = $00;
  867.  
  868.   { If Active, Alarm Time is: 2:15:30 PM }
  869.  
  870.   If Active Then
  871.   BEGIN
  872.  
  873.     Active := ResetAlarmTime( DecToBCD(8),
  874.                               DecToBCD(30),
  875.                               DecToBCD(0)  ) = $00;
  876.  
  877.     WriteLn( 'Alarm Set to New Time : ', Alarm );
  878.  
  879.     { If Active, Alarm Time is now: 8:30:00 AM }
  880.  
  881.   END  { If Active }
  882.  
  883.   Else
  884.     WriteLn( 'Alarm Never Accepted 1st Alarm Time!' );
  885.  
  886. END;
  887.  
  888.  
  889. ──────────────────────────────────────────────────────────────────────────────
  890.  
  891.  
  892. [FUNCTION]
  893.  
  894. Function UnSetAlarmTime                                        : BYTE;
  895.  
  896. [PARAMETERS]
  897.  
  898. (None)
  899.  
  900. [RETURNS]
  901.  
  902. Status Code ($00 = Success)
  903.  
  904. [DESCRIPTION]
  905.  
  906. Low-Level Function to turn the System Alarm Timer Off.
  907.  
  908. NOTE: This Requires the caller to have Installed an Alarm Clock
  909. Interrupt Procedure (Thru SetAlarmProc) otherwise it will return
  910. an Error.
  911.  
  912. [SEE-ALSO]
  913.  
  914. SetAlarmTime
  915. ResetAlarmTime
  916.  
  917. [EXAMPLE]
  918.  
  919. VAR
  920.   Active : BOOLEAN;
  921.  
  922. BEGIN
  923.  
  924.   Active := SetAlarmTime( DecToBCD(14), DecToBCD(15), DecToBCD(30) ) = $00;
  925.  
  926.   If Active Then
  927.   BEGIN
  928.  
  929.     Active := UnSetAlarmTime = $00;
  930.  
  931.     WriteLn( 'Alarm Time is Active : ',Active )
  932.     WriteLn( 'The alarm will now go off at 2:15:30PM' );
  933.  
  934.   END  { If Active }
  935.  
  936.   Else
  937.     WriteLn( 'Alarm was Never Activated!' );
  938.  
  939. END;
  940.  
  941.  
  942. ──────────────────────────────────────────────────────────────────────────────
  943.  
  944.  
  945. [FUNCTION]
  946.  
  947. Function SetAlarmOn(              Time           : TTime     ) : BOOLEAN;
  948.  
  949. [PARAMETERS]
  950.  
  951. Time        Time to Set the Alarm To
  952.  
  953. [RETURNS]
  954.  
  955. Was the Alarm Time Set?
  956.  
  957. [DESCRIPTION]
  958.  
  959. Turns on the RealTime Alarm Clock based upon the time passed in.
  960. This operation will Overwrite any previously set time.
  961.  
  962. [SEE-ALSO]
  963.  
  964. AlarmCallFlag
  965. SetAlarmOff
  966. AlarmIsSet
  967. AlarmWasCalled
  968.  
  969. [EXAMPLE]
  970.  
  971. VAR
  972.   Time : TTime;
  973.  
  974. BEGIN
  975.  
  976.   Time := HMStoTime( 14, 15, 30 );
  977.  
  978.   If SetAlarmOn( Time ) Then
  979.     WriteLn( 'Alarm is ACTIVE' )
  980.   Else
  981.     WriteLn( 'Alarm FAILED to Activate!' );
  982.  
  983.   { If Successful, Alarm Time is now set for 2:15:30 PM }
  984.  
  985. END;
  986.  
  987.  
  988. ──────────────────────────────────────────────────────────────────────────────
  989.  
  990.  
  991. [FUNCTION]
  992.  
  993. Function SetAlarmOff                                           : BOOLEAN;
  994.  
  995. [PARAMETERS]
  996.  
  997. (None)
  998.  
  999. [RETURNS]
  1000.  
  1001. Was the Alarm Turned Off Successfully?
  1002.  
  1003. [DESCRIPTION]
  1004.  
  1005. Turns off any current RealTime Alarm Clock alarm Times.
  1006.  
  1007. [SEE-ALSO]
  1008.  
  1009. AlarmCallFlag
  1010. SetAlarmOn
  1011. AlarmIsSet
  1012. AlarmWasCalled
  1013.  
  1014. [EXAMPLE]
  1015.  
  1016. BEGIN
  1017.  
  1018.   WriteLn( SetAlarmOff );
  1019.  
  1020.   { If RTC Alarm Disabled successfully, Displays 'TRUE' }
  1021.  
  1022. END;
  1023.  
  1024.  
  1025. ──────────────────────────────────────────────────────────────────────────────
  1026.  
  1027.  
  1028. [FUNCTION]
  1029.  
  1030. Function AlarmIsSet                                            : BOOLEAN;
  1031.  
  1032. [PARAMETERS]
  1033.  
  1034. (None)
  1035.  
  1036. [RETURNS]
  1037.  
  1038. Is the Alarm Clock Currently Set?
  1039.  
  1040. [DESCRIPTION]
  1041.  
  1042. Returns whether or not the Alarm Clock is currently set.  This function
  1043. isolates the caler from the Previous Time data information.
  1044.  
  1045. [SEE-ALSO]
  1046.  
  1047. AlarmCallFlag
  1048. SetAlarmOn
  1049. SetAlarmOff
  1050. AlarmWasCalled
  1051.  
  1052. [EXAMPLE]
  1053.  
  1054. BEGIN
  1055.  
  1056.   If SetAlarmOn Then;
  1057.  
  1058.   WriteLn( AlarmIsSet );
  1059.  
  1060.   { If RTC Alarm Set successfully, Diplays 'TRUE' }
  1061.  
  1062. END;
  1063.  
  1064.  
  1065. ──────────────────────────────────────────────────────────────────────────────
  1066.  
  1067.  
  1068. [FUNCTION]
  1069.  
  1070. Function AlarmWasCalled                                        : BOOLEAN;
  1071.  
  1072. [PARAMETERS]
  1073.  
  1074. (None)
  1075.  
  1076. [RETURNS]
  1077.  
  1078. Has the Alarm been Called?
  1079.  
  1080. [DESCRIPTION]
  1081.  
  1082. [SEE-ALSO]
  1083.  
  1084. AlarmCallFlag
  1085. SetAlarmOn
  1086. SetAlarmOff
  1087. AlarmIsSet
  1088.  
  1089. [EXAMPLE]
  1090.  
  1091. BEGIN
  1092.  
  1093.   WriteLn( AlarmWasCalled );
  1094.  
  1095.   { If Alarm Called Flag was set, Displays 'TRUE' else 'FALSE' }
  1096.  
  1097. END;
  1098.  
  1099.  
  1100. ──────────────────────────────────────────────────────────────────────────────
  1101.  
  1102.  
  1103. [FUNCTION]
  1104.  
  1105. Procedure GetSysTime(         Var BcdHour        : BYTE;
  1106.                               Var BcdMin         : BYTE;
  1107.                               Var BcdSec         : BYTE      );
  1108.  
  1109. [PARAMETERS]
  1110.  
  1111. BcdHour     VAR Returned RealTime Clock Hours
  1112. BcdMin      VAR Returned RealTime Clock Minutes
  1113. BcdSec      VAR Returned RealTime Clock Seconds
  1114.  
  1115. [RETURNS]
  1116.  
  1117. (Function : None)
  1118. (VAR      : [BcdHour] RealTime Clock Hours)
  1119. (VAR      : [BcdMin] RealTime Clock Minutes)
  1120. (VAR      : [BcdSec] RealTime Clock Seconds)
  1121.  
  1122. [DESCRIPTION]
  1123.  
  1124. Returns the System Time as reported by the Battery powered
  1125. Motorola MC-146818 processor chip.  May not always jibe with
  1126. DOS's System Time.
  1127.  
  1128. [SEE-ALSO]
  1129.  
  1130. SetSysTime
  1131. GetSysDate
  1132. SetSysDate
  1133.  
  1134. [EXAMPLE]
  1135.  
  1136. VAR
  1137.   Hr,Min,Sec : BYTE;
  1138.  
  1139. BEGIN
  1140.  
  1141.   GetSysTime( Hr, Min, Sec );
  1142.  
  1143.   WriteLn( BCDtoDec(Hr), ':', BCDtoDec(Min), ':', BCDtoDec(Sec) );
  1144.  
  1145.   { Displays the Date as according to the RTC }
  1146.  
  1147. END;
  1148.  
  1149.  
  1150. ──────────────────────────────────────────────────────────────────────────────
  1151.  
  1152.  
  1153. [FUNCTION]
  1154.  
  1155. Procedure SetSysTime(             BcdHour        : BYTE;
  1156.                                   BcdMin         : BYTE;
  1157.                                   BcdSec         : BYTE      );
  1158.  
  1159. [PARAMETERS]
  1160.  
  1161. BcdHour     Hour to set RTC to
  1162. BcdMin      Minute to set RTC to
  1163. BcdSec      Second to set RTC to
  1164.  
  1165. [RETURNS]
  1166.  
  1167. (None)
  1168.  
  1169. [DESCRIPTION]
  1170.  
  1171. Returns the System Time as reported by the Battery powered
  1172. Motorola MC-146818 processor chip.  May not always jibe with
  1173. DOS's System Time.
  1174.  
  1175. [SEE-ALSO]
  1176.  
  1177. GetSysTime
  1178. GetSysDate
  1179. SetSysDate
  1180.  
  1181. [EXAMPLE]
  1182.  
  1183. BEGIN
  1184.  
  1185.   SetSysTime( DecToBCD( 14 ), DecToBCD( 15 ), DecToBCD( 30 ) );
  1186.  
  1187.   { Sets the RTC Time to 2:15:30 PM }
  1188.  
  1189. END;
  1190.  
  1191.  
  1192. ──────────────────────────────────────────────────────────────────────────────
  1193.  
  1194.  
  1195. [FUNCTION]
  1196.  
  1197. Procedure GetSysDate(         Var BcdDay         : BYTE;
  1198.                               Var BcdMonth       : BYTE;
  1199.                               Var BcdYear        : BYTE;
  1200.                               Var BcdCent        : BYTE;
  1201.                               Var BcdDOW         : BYTE      );
  1202.  
  1203. [PARAMETERS]
  1204.  
  1205. BcdDay   (BYTE) Returning BCD Day
  1206. BcdMonth (BYTE) Returning BCD Month
  1207. BcdYear  (BYTE) Returning BCD Year (MOD 100)
  1208. BcdCent  (BYTE) Returning BCD Century (DIV 100)
  1209. BcdDOW   (BYTE) Returning BCD DayOfWeek (base=1)
  1210.  
  1211. [RETURNS]
  1212.  
  1213. (Function : None)
  1214. (VAR      : [BcdDay] Returning BCD Day               )
  1215. (VAR      : [BcdMonth] Returning BCD Month           )
  1216. (VAR      : [BcdYear] Returning BCD Year (MOD 100)   )
  1217. (VAR      : [BcdCent] Returning BCD Century (DIV 100))
  1218. (VAR      : [BcdDOW] Returning BCD DayOfWeek (base=1))
  1219.  
  1220. [DESCRIPTION]
  1221.  
  1222. Returns the System Time as reported by the Battery powered
  1223. Motorola MC-146818 processor chip.  May not always jibe with
  1224. DOS's System Time.
  1225.  
  1226. [SEE-ALSO]
  1227.  
  1228. GetSysTime
  1229. SetSysTime
  1230. SetSysDate
  1231.  
  1232. [EXAMPLE]
  1233.  
  1234. VAR
  1235.   Day,Mon,Yr,
  1236.   Cent,DOW   : BYTE;
  1237.  
  1238. BEGIN
  1239.  
  1240.   GetSysDate( Day, Mon, Yr, Cent, DOW );
  1241.  
  1242.   WriteLn( 'Day=',BCDtoDec(Day),
  1243.            'Mon=',BCDtoDec(Mon),
  1244.            'Yr =',BCDtoDec(Cent)*100 + BCDtoDec(Yr) );
  1245.            'DayOfWeek=',BCDtoDec(DOW) );
  1246. END;
  1247.  
  1248.  
  1249. ──────────────────────────────────────────────────────────────────────────────
  1250.  
  1251.  
  1252. [FUNCTION]
  1253.  
  1254. Procedure SetSysDate(             BcdDay         : BYTE;
  1255.                                   BcdMonth       : BYTE;
  1256.                                   BcdYear        : BYTE;
  1257.                                   BcdCent        : BYTE;
  1258.                                   BcdDOW         : BYTE      );
  1259.  
  1260. [PARAMETERS]
  1261.  
  1262. BcdDay      New Day in BCD Format
  1263. BcdMonth    New Month in BCD Format
  1264. BcdYear     New Year (MOD 100) in BCD Format
  1265. BcdCent     New Century (DIV 100) in BCD Format
  1266. BcdDOW      New DayOfWeek (base=1) in BCD Format
  1267.  
  1268. [RETURNS]
  1269.  
  1270. (None)
  1271.  
  1272. [DESCRIPTION]
  1273.  
  1274. Sets the System Time of the Battery powered Motorola MC-146818
  1275. processor chip.
  1276.  
  1277. There is NO Range or Error Checking so Caller MUST ensure the
  1278. Date/DayOfWeek is Valid prior to Calling.
  1279.  
  1280. [SEE-ALSO]
  1281.  
  1282. GetSysTime
  1283. SetSysTime
  1284. GetSysDate
  1285.  
  1286. [EXAMPLE]
  1287.  
  1288. BEGIN
  1289.  
  1290.   SetSysDate( DecToBCD( 1 ), DecToBCD( 2 ), DecToBCD( 00 ),
  1291.               DecToBCD( 19 ), DevToBCD( 0 ) );
  1292.  
  1293.   { Will Set the RTC Date to 1 Feb 1990, SUN (whether or not it is valid) }
  1294.  
  1295. END;
  1296.  
  1297.  
  1298. ──────────────────────────────────────────────────────────────────────────────
  1299.  
  1300.  
  1301. [FUNCTION]
  1302.  
  1303. Function GetSystemTime                                         : TTime;
  1304.  
  1305. [PARAMETERS]
  1306.  
  1307. (None)
  1308.  
  1309. [RETURNS]
  1310.  
  1311. RealTime Clock Current System Time
  1312.  
  1313. [DESCRIPTION]
  1314.  
  1315. Returns the System Time as reported by the Battery powered
  1316. Motorola MC-146818 processor chip.  May not always jibe with
  1317. DOS's System Time.
  1318.  
  1319. [SEE-ALSO]
  1320.  
  1321. GetSystemDate
  1322. SyncSystemTime
  1323. SyncSystemDate
  1324.  
  1325. [EXAMPLE]
  1326.  
  1327. BEGIN
  1328.  
  1329.   WriteLn( TimeToStr( GetSystemTime ) );
  1330.  
  1331.   { Will Display the Time as according to the RTC }
  1332.  
  1333. END;
  1334.  
  1335.  
  1336. ──────────────────────────────────────────────────────────────────────────────
  1337.  
  1338.  
  1339. [FUNCTION]
  1340.  
  1341. Function GetSystemDate                                         : TDate;
  1342.  
  1343. [PARAMETERS]
  1344.  
  1345. (None)
  1346.  
  1347. [RETURNS]
  1348.  
  1349. RealTime Clock Current System Date
  1350.  
  1351. [DESCRIPTION]
  1352.  
  1353. Returns the System Date as reported by the Battery powered
  1354. Motorola MC-146818 processor chip.  May not always jibe with
  1355. DOS's System Date.
  1356.  
  1357. [SEE-ALSO]
  1358.  
  1359. GetSystemTime
  1360. SyncSystemTime
  1361. SyncSystemDate
  1362.  
  1363. [EXAMPLE]
  1364.  
  1365. BEGIN
  1366.  
  1367.   WriteLn( DateToStr( GetSystemData ) );
  1368.  
  1369.   { Will Display the Date as according to the RTC }
  1370.  
  1371. END;
  1372.  
  1373.  
  1374. ──────────────────────────────────────────────────────────────────────────────
  1375.  
  1376.  
  1377. [FUNCTION]
  1378.  
  1379. Procedure Sync;
  1380.  
  1381. [PARAMETERS]
  1382.  
  1383. (None)
  1384.  
  1385. [RETURNS]
  1386.  
  1387. (None)
  1388.  
  1389. [DESCRIPTION]
  1390.  
  1391. This Procedure Synchronizes the Battery System Clock with (what
  1392. I consider to be the more Reliable) DOS System Clock.  It is
  1393. 100% Assembly to get the Synchronization as accurate as possible.
  1394. The tolerance is within One (1) Second which should be enough for
  1395. most applications.
  1396.  
  1397. Also, In order to truly Sync the Clocks, you must call this routine
  1398. at the exact instant of the 1st tick of the new second.  In other
  1399. words, both Clocks should be Synchronized at the exact beginning of
  1400. the same Second to ensure a nearly exact time synchronization.
  1401.  
  1402. NOTE: Only Sychronizes the Clock Time not Date.
  1403.  
  1404. [SEE-ALSO]
  1405.  
  1406. AccuSync
  1407.  
  1408. [EXAMPLE]
  1409.  
  1410. BEGIN
  1411.  
  1412.   Sync;
  1413.  
  1414.   { RTC Times should be within a Second of Synchronization with DOS Times }
  1415.  
  1416. END;
  1417.  
  1418.  
  1419. ──────────────────────────────────────────────────────────────────────────────
  1420.  
  1421.  
  1422. [FUNCTION]
  1423.  
  1424. Procedure AccuSync;
  1425.  
  1426. [PARAMETERS]
  1427.  
  1428. (None)
  1429.  
  1430. [RETURNS]
  1431.  
  1432. (None)
  1433.  
  1434. [DESCRIPTION]
  1435.  
  1436. In order to truly Sync the Clocks, you must call the Sync routine
  1437. at the exact instant of the 1st tick of the new second.  In other
  1438. words, both Clocks should be Synchronized at the exact beginning
  1439. of the same Second to ensure a nearly exact time synchronization.
  1440.  
  1441. [SEE-ALSO]
  1442.  
  1443. Sync
  1444.  
  1445. [EXAMPLE]
  1446.  
  1447. BEGIN
  1448.  
  1449.   AccuSync;
  1450.  
  1451.   { RTC Times should be in Synchronization with the DOS Times }
  1452.  
  1453. END;
  1454.  
  1455.  
  1456. ──────────────────────────────────────────────────────────────────────────────
  1457.  
  1458.  
  1459. [FUNCTION]
  1460.  
  1461. Procedure SyncSystemTime(         NewTime        : TTime     );
  1462.  
  1463. [PARAMETERS]
  1464.  
  1465. NewTime     New Time to Set RTC Time to
  1466.  
  1467. [RETURNS]
  1468.  
  1469. (None)
  1470.  
  1471. [DESCRIPTION]
  1472.  
  1473. This Procedure Synchronizes the Battery System Clock with (what I
  1474. consider to be the more Reliable) DOS System Clock.  Synchronization
  1475. as accurate is within One (1) Second which should be enough for most
  1476. applications.
  1477.  
  1478. [SEE-ALSO]
  1479.  
  1480. GetSystemTime
  1481. GetSystemDate
  1482. SyncSystemDate
  1483.  
  1484. [EXAMPLE]
  1485.  
  1486. VAR
  1487.   Time : TTime;
  1488.  
  1489. BEGIN
  1490.  
  1491.   Time := HMStoTime( 14, 15, 30 );
  1492.  
  1493.   SyncSystemTime( Time );
  1494.  
  1495.   { The New RTC Time will be 2:15:30PM }
  1496.  
  1497. END;
  1498.  
  1499.  
  1500. ──────────────────────────────────────────────────────────────────────────────
  1501.  
  1502.  
  1503. [FUNCTION]
  1504.  
  1505. Procedure SyncSystemDate(         NewDate        : TDate     );
  1506.  
  1507. [PARAMETERS]
  1508.  
  1509. NewTime     New Time To Set RTC Time To
  1510.  
  1511. [RETURNS]
  1512.  
  1513. (None)
  1514.  
  1515. [DESCRIPTION]
  1516.  
  1517. This Procedure Synchronizes the Battery System Clock with (what I
  1518. consider to be the more Reliable) DOS System Clock.
  1519.  
  1520. [SEE-ALSO]
  1521.  
  1522. GetSystemTime
  1523. GetSystemDate
  1524. SyncSystemTime
  1525.  
  1526. [EXAMPLE]
  1527.  
  1528. VAR
  1529.   Date : TDate;
  1530.  
  1531. BEGIN
  1532.  
  1533.   Date := DMYtoDate( 1,2,1990 );
  1534.   SyncSystemDate( Date );
  1535.  
  1536.   { The New RTC Date will be set to 2 Feb 1990 }
  1537.  
  1538. END;
  1539.  
  1540.  
  1541. ──────────────────────────────────────────────────────────────────────────────
  1542.  
  1543.  
  1544. [FUNCTION]
  1545.  
  1546. Function  GetDayLightSavings                                   : BOOLEAN;
  1547.  
  1548. [PARAMETERS]
  1549.  
  1550. (None)
  1551.  
  1552. [RETURNS]
  1553.  
  1554. Is DayLight Savings Set?
  1555.  
  1556. [DESCRIPTION]
  1557.  
  1558. Returns whether or not the RealTime Clock DayLight Savings is
  1559. Activated.
  1560.  
  1561. [SEE-ALSO]
  1562.  
  1563. SetDayLightSavings
  1564.  
  1565. [EXAMPLE]
  1566.  
  1567. BEGIN
  1568.  
  1569.   WriteLn( 'RTC Daylight Savings is Active : ', GetDayLightSavings );
  1570.  
  1571.   { If DLS is Active in the RTC Register then reports TRUE else FALSE }
  1572.  
  1573. END;
  1574.  
  1575.  
  1576. ──────────────────────────────────────────────────────────────────────────────
  1577.  
  1578.  
  1579. [FUNCTION]
  1580.  
  1581. Procedure SetDayLightSavings(     DLS            : BOOLEAN   );
  1582.  
  1583. [PARAMETERS]
  1584.  
  1585. DLS         Whether DayLight Savings is to be Set
  1586.  
  1587. [RETURNS]
  1588.  
  1589. (None)
  1590.  
  1591. [DESCRIPTION]
  1592.  
  1593. Sets the RealTime Clock Day Light Savings according to the Flag
  1594. you pass in.
  1595.  
  1596. [SEE-ALSO]
  1597.  
  1598. GetDayLightSavings
  1599.  
  1600. [EXAMPLE]
  1601.  
  1602. BEGIN
  1603.  
  1604.  SetDayLightSavings( TRUE );
  1605.  
  1606.  { DayLight Savings Time is Now Valid in the RTC registers }
  1607.  
  1608. END;
  1609.  
  1610.